import 'package:flutter/material.dart';

class MyApp2 extends StatelessWidget {
  const MyApp2({super.key, required this.title, required this.subTitle});

  final String title;
  final String subTitle;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        // 1.1 导航
        appBar: AppBar(
          backgroundColor: Colors.pink,
          title: Text(title),
        ),
        // 1.2 主体部分
        body: Container(
          width: MediaQuery.of(context).size.width,
          // color: Colors.blue,
          margin: const EdgeInsets.all(20),
          padding: const EdgeInsets.all(30),
          // alignment: Alignment.bottomRight,

          decoration: BoxDecoration(
              border: Border.all(color: Colors.orange, width: 10),
              color: Colors.purple,
              borderRadius:
                  const BorderRadius.only(topRight: Radius.circular(10))),
          child: Center(
            child: Text(
              subTitle,
              style: const TextStyle(
                  color: Colors.pink, fontStyle: FontStyle.italic),
            ),
          ),
        ));
  }
}
